package com.neusmart.tongrentang.constants;


import com.neusmart.tongrentang.F;

/**
 * API
 * <p/>
 * roy
 */
public enum API {

    /* AppVersion API */
    //获取最新的App版本升级信息
    APP_VERSION_LATEST("AppVersion/Latest", HttpMethod.GET),

    /* AuthToken API */
    //检查authToken是否有效
    CHECK_AUTHTOKEN("AuthToken/Check", HttpMethod.POST),

    //获取当前设备调用API环境
    DEVICE_ENVIRONMENT_GET("DeviceEnvironment/Get", HttpMethod.GET),

    /* Banner API */
    //通过位置获取横幅列表
    BANNER_LIST("Banner/List", HttpMethod.GET),

    /* Cache API */
    //获取网站所有cache的key
    GET_CACHE_KEYS("Cache/GetKeys", HttpMethod.GET),
    //根据keyname删除指定cache
    REMOVE_CACHE("Cache/Remove", HttpMethod.POST_JSON),


    //向对方发送消息
    SEND_CHAT_MSG("ChatMsg/Send", HttpMethod.POST_JSON),
    //获取消息ID小于传入的chatMsgId的takeCount历史消息
    CHAT_MSG_HISTORIES("ChatMsg/Histories", HttpMethod.GET),
    CHAT_MSG_MORE_HISTORIES("ChatMsg/Histories", HttpMethod.GET),
    //获取消息ID大于传入的chatMsgId最新消息
    CHAT_MSG_LATEST("ChatMsg/Latest", HttpMethod.GET),

    /* Enum API */
    //性别枚举
    GENDER("Enum/Gender", HttpMethod.GET),
    //用户类型枚举
    USER_TYPE("Enum/UserType", HttpMethod.GET),
    //设备类型枚举
    DEVICE_TYPE("Enum/DeviceType", HttpMethod.GET),
    //返回码枚举
    RESPONSE_CODE("Enum/ResponseCode", HttpMethod.GET),
    //最新最旧排序方式枚举
    SORT_OPTION("Enum/SortOption", HttpMethod.GET),
    //社区互动类型
    SNS_INTERACTION_TYPE("Enum/SNSInteractionType", HttpMethod.GET),
    //微社区话题板块显示设置类别
    SNS_TOPIC_PLATE_CONFIG("Enum/SNSTopicPlateConfig", HttpMethod.GET),
    //获取短信行为枚举
    SHORT_MSG_CODE_BEHAVIOR("Enum/ShortMsgCodeBehavior", HttpMethod.GET),

    /* Feedback */
    //提交用户反馈
    SUBMIT_FEEDBACK("Feedback/Post", HttpMethod.POST_JSON),

    /* File API */
    //上传上报通知
    UPLOAD_NOTIFY("File/UploadNotify", HttpMethod.POST_JSON),
    //返回AliOSS android 和IOS sdk 所需要的签名
    ALI_OSS_SIGN("File/AliOssSign", HttpMethod.POST_JSON),
    //返回私有文件
    GET_PRIVATE("File/GetPrivate", HttpMethod.GET),

    /* Geo API */
    //获取省份并且返回省份下面的城市
    GEO_PROVINCES("Geo/Provinces", HttpMethod.GET),

    /* ShortMsgCode API */
    //根据不同行为获取短信验证码
    GET_SHORT_MSG_CODE("ShortMsgCode/Get", HttpMethod.GET),

    /* SNS API */
    //获取社区排行列表
    CLUB_RANK_LIST("SNS/ClubRankList", HttpMethod.GET),
    //发表话题时选择社区的下拉选项
    CLUB_OPTIONS("SNS/ClubOptions", HttpMethod.GET),
    //获取推荐社区
    GET_RECOMMENDED_CLUBS("SNS/GetRecommendedClubs", HttpMethod.GET),
    //查找社区
    SEARCH_CLUBS("SNS/SearchClubs", HttpMethod.POST),
    //通过社区ID获取对应社区
    GET_CLUB("SNS/GetClub", HttpMethod.GET),
    //获取用户所关注的社区
    GET_USER_CLUBS("SNS/GetUserClubs", HttpMethod.GET),
    //通过话题ID获取所对应的回复
    GET_REPLIES("SNS/GetReplies", HttpMethod.GET),
    //获取话题板块话题或者具体社区话题
    GET_TOPICS("SNS/GetTopics", HttpMethod.GET),
    //获取用户发表的话题
    GET_USER_TOPICS("SNS/GetUserTopics", HttpMethod.GET),
    //获取话题详情
    GET_TOPIC("SNS/GetTopic", HttpMethod.GET),
    //删除指定话题
    REMOVE_TOPIC("SNS/RemoveTopic", HttpMethod.POST),
    //删除指定回复
    REMOVE_REPLY("SNS/RemoveReply", HttpMethod.POST),
    //通过回复ID获取对应的回复
    GET_REPLY("SNS/GetReply", HttpMethod.GET),
    //新增话题
    ADD_TOPIC("SNS/AddTopic", HttpMethod.POST_JSON),
    //对话题投票（支持或者反对）
    VOTE_TOPIC("SNS/VoteTopic", HttpMethod.POST_JSON),
    //对回复投票（支持或者反对）
    VOTE_REPLY("SNS/VoteReply", HttpMethod.POST_JSON),
    //回复话题
    REPLY("SNS/Reply", HttpMethod.POST_JSON),
    //对回复进行回复
    TO_REPLY("SNS/ToReply", HttpMethod.POST_JSON),
    //加入社区（关注社区）
    JOIN_CLUB("SNS/JoinClub", HttpMethod.POST),
    //退出社区（取消关注社区）
    EXIT_CLUB("SNS/ExitClub", HttpMethod.POST),
    //获取用户社区基本信息
    GET_USER_CLUB_INFO("SNS/GetUserClubInfo", HttpMethod.GET),
    //获取举报原因列表
    GET_REPORT_REASONS("SNS/GetReportReasons", HttpMethod.GET),
    //举报话题
    REPORT_TOPIC("SNS/ReportTopic", HttpMethod.POST_JSON),
    //获取登陆用户互动消息
    GET_INTERACTION_MSGS("SNS/GetInteractionMsgs", HttpMethod.GET),
    //清除当前登陆用户互动消息
    CLEAR_INTERACTION_MSG("SNS/ClearInteractionMsg", HttpMethod.POST),
    //获取当前登陆用户未读互动消息数
    GET_UNREAD_MSG_CNT("SNS/GetUnreadMsgCnt", HttpMethod.GET),
    //设置当前登录用户话题板块如何显示
    CONFIG_TOPIC_PLATE("SNS/ConfigTopicPlate", HttpMethod.POST),
    //获取当前登录用户话题板块设置
    GET_TOPIC_PLATE_CONFIG("SNS/GetTopicPlateConfig", HttpMethod.GET),
    //根据当前登录用户，获取微社区相关初始化数据
    GET_INIT_DATA("SNS/GetInitData", HttpMethod.GET),
    //更新或新增社区(支持局部更新操作)
    ADD_OR_UPDATE_CLUB("SNS/AddOrUpdateClub", HttpMethod.POST_JSON),
    //删除社区
    REMOVE_CLUBS("SNS/RemoveClubs", HttpMethod.POST_JSON),

    /* SysMsg API */
    //系统消息列表
    SYS_MSG_LIST("SysMsg/List", HttpMethod.GET),
    //清空历史消息
    SYS_MSG_CLEAR("SysMsg/Clear", HttpMethod.POST),
    //当前用户登录未读系统消息数
    SYS_MSG_UNREAD_CNT("SysMsg/UnreadCnt", HttpMethod.GET),

    /* User Friend API */
    //添加好友
    ADD_FRIEND("User/Friend/Add", HttpMethod.POST),
    //删除好友
    REMOVE_FRIEND("User/Friend/Remove", HttpMethod.POST),
    //同意好友申请
    AGREE_FRIEND("User/Friend/Agree", HttpMethod.POST),
    //获取好友列表
    GET_FRIEND_LIST("User/Friend/List", HttpMethod.GET),
    //获取好友申请列表
    GET_FRIEND_REQ_LIST("User/Friend/ReqList", HttpMethod.GET),
    //未读好友申请数
    GET_FRIEND_UNREAD_REQ_CNT("User/Friend/UnreadReqCnt", HttpMethod.GET),

    /* User Photo API*/
    //获取用户所有照片数据
    GET_USER_PHOTO_LIST("User/Photo/List", HttpMethod.GET),
    //添加照片，添加之前先做文件上报通知（File/UploadNotify），接着调用Alios sdk进行上传
    ADD_USER_PHOTO("User/Photo/Add", HttpMethod.POST_JSON),
    //删除照片
    REMOVE_USER_PHOTO("User/Photo/Remove", HttpMethod.POST),

    /* Stream API */
    //开始播放视频
    STREAM_START("VideoTeaching/Stream/Start", HttpMethod.POST),
    //结束播放视频
    STREAM_END("VideoTeaching/Stream/End", HttpMethod.POST),

    /* User API */
    //通过手机号注册
    REGISTER("User/Register", HttpMethod.POST_JSON),
    //登录
    LOGIN("User/Login", HttpMethod.POST_JSON),
    //修改密码
    CHANGE_PASSWORD("User/ChangePassword", HttpMethod.POST_JSON),
    //修改手机号码
    CHANGE_PHONE("User/ChangePhone", HttpMethod.POST_JSON),
    //忘记密码
    FORGET_PASSWORD("User/ForgetPassword", HttpMethod.POST_JSON),
    //登出
    LOGOUT("User/Logout", HttpMethod.POST),
    //根据用户ID获取用户信息，如果传入的用户ID与登陆用户ID不一致，则会忽略返回敏感信息如驾驶证等)
    GET_PROFILE("User/GetProfile", HttpMethod.GET),
    //修改登陆用户信息 (支持局部更新，不传入该属性或者设置某个属性值为NULL，而不是空)
    //UPDATE_PROFILE("User/UpdateProfile", HttpMethod.POST_JSON),
    UPDATE_PROFILE_AVATAR("User/UpdateProfile", HttpMethod.POST_JSON),
    UPDATE_PROFILE_NAME("User/UpdateProfile", HttpMethod.POST_JSON),
    UPDATE_PROFILE_BIRTHDAY("User/UpdateProfile", HttpMethod.POST_JSON),
    UPDATE_PROFILE_GENDER("User/UpdateProfile", HttpMethod.POST_JSON),
    UPDATE_PROFILE_REGION("User/UpdateProfile", HttpMethod.POST_JSON),

    ;

    String method;
    HttpMethod httpMethod;

    API(String method, HttpMethod httpMethod) {
        this.method = method;
        this.httpMethod = httpMethod;
    }

    public HttpMethod getHttpMethod() {
        return httpMethod;
    }

    public String getUrl() {
        return F.domain + "api/v1/" + method;
    }

}
